<template>
  <div>
    <div class="top_parent">
      <img src="../../assets/image/zyzzj_bg.png" alt />
      <div class="bread">
        <p>
          <router-link to="/"> 首页 </router-link> 》<span>{{
            data1[0].title
          }}</span>
        </p>
      </div>
    </div>
    <div class="cgxz_k">
      <span v-html="data1[0].zhengwen"></span>
    </div>
    <foot2 class="dibu"></foot2>
  </div>
</template>
<script>
import foot2 from "../../components/foot2";
export default {
  name: "show",
  data() {
    return {
      data1: [{}]
    };
  },
  components: {
    foot2: foot2
  },
  created() {
    this.get();
  },
  methods: {
    get() {
      this.$api.get(`${this.tableList}canguanxuzhi`).then(res => {
        this.data1 = res.data.page.list;

        let data = res.data.page.list;
        var pic = data[0].zhengwen;
        // console.log(pic)
        var newPic = pic.replace(/src=[\'\"]?([^\'\"]*)[\'\"]?/gi, keyword => {
          keyword = keyword.split('"')[1];

          return 'src="' + this.IP + keyword + '"';
        });
        // var a=pic.replace(/<a[^>]+href=['"]([^'"]*)['"]>/gi,(keyword)=>{
        //   keyword=keyword.split('"')[1]
        //   console.log(keyword)
        //   return `<a href="http://47.110.243.129${keyword}">http://47.110.243.129`
        // })
        // console.log(a)
        // data.metadata[0].value=a

        data[0].zhengwen = newPic;
        this.data1 = data;
      });
    }
  }
};
</script>
<style scoped>
a {
  text-decoration: none;
  color: #6e6e6e;
}
.top_parent {
  position: relative;
}
.top_parent .bread {
  max-width: 1200px;
  margin: auto;
}
.top_parent p {
  position: absolute;
  bottom: 20px;
  color: #6e6e6e;
}

.cgxz_k {
  max-width: 1200px;
  margin: auto;
  margin-bottom: 50px;
  padding-top: 44px;
}
</style>
